public class Fibonacci {
    // 斐波拉契数列
    // https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=295&tqId=23255&sourceUrl=%2Fexam%2Foj%3FquestionJobId%3D10%26subTabName%3Donline_coding_page
    public int Fibonacci (int n) {
        // write code here
        int num1 = 1, num2 = 1;
        for (int i = 3; i <= n; i++) {
            int tmp = num1 + num2;
            num1 = num2;
            num2 = tmp;
        }
        return num2;
    }
}
